
SDCC=$(shell pwd)/tools/pbccv2.1/bin/sdcc.exe
SDCC_INC=$(shell pwd)/tools/pbccv2-bin-win32-cygwin-2011-10-24/include/pblaze 



soft_%:
	@mkdir -p build
	@cd build && $(SDCC) ../soft/$@.c -mpblaze -S -I$(SDCC_INC) -I$(shell pwd)/../soft -o firmware.asm 
	@cd build && sed -i 's/ADDRESS	3ff/ADDRESS	$(CODE_INTERRUPT_VECTOR)/g' firmware.asm
	@cd build && opbasm --m4 -6 -e 0x$(CODE_INTERRUPT_VECTOR) --mem-size $(CODE_SZIE)  firmware.asm
	@cd build && cp firmware.mem firmware.hex  && sed -i '1d' firmware.hex 
	